<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >

	<ui:composition template="/templates/gerenciamento.xhtml" >
		<ui:define name="js">
		
		</ui:define>
		<ui:define name="css">
			<link rel="stylesheet" type="text/css" href="style/folha_gerenciamento.css" media="screen" />
			<link rel="stylesheet" type="text/css" href="style/logado.css" media="screen" />
			<style type="text/css">
			body {
				margin-left: 0px;
				margin-top: 0px;
				margin-right: 0px;
				margin-bottom: 0px;
			}
			</style>
		</ui:define>
		<ui:define name="mid">
			<h:form>
				
				<div style="width: 400px; margin: 0 auto; font-family: Tahoma, Geneva, sans-serif;" align="center" >
					<h:outputText value="Produto: #{consulteCompareProdutosBean.produto.nome}, Unidade: #{consulteCompareProdutosBean.produto.unidade}" />
					
					<a4j:commandLink action="#{consulteCompareProdutosBean.voltarBusca}" execute="@form" render="@all" >
	       				<img src="images/voltar.jpg" />
	       			</a4j:commandLink>
				</div>

				<div class="inside_extrato">
  					<div class="ranking_inside_titulo" align="center"><strong>Menores Preços</strong></div>
  					<div class="inside_caixa_cinza2">
					    <table width="690" border="0" cellspacing="1" cellpadding="0">
					      	
					      	<tr id="texto_branco">
				        		<td width="390" height="35" align="center" bgcolor="#2f3191"><strong>Estabelecimento</strong></td>
					        	<td width="100" align="center" bgcolor="#2f3191"><strong>Valor Normal</strong></td>
					        	<td width="100" align="center" bgcolor="#2f3191"><strong>Valor com Desconto</strong></td>
					        	<td width="100" align="center" bgcolor="#2f3191"><strong>Data Limite da Oferta</strong></td>
					      	</tr>
					      	
					      	<a4j:repeat value="#{consulteCompareProdutosBean.gradeProdutos}" var="gp">
					      	
					      		<tr>
						        	<td colspan="7" bgcolor="#FFFFFF"><img src="images/3px.gif" alt="" width="3" height="3" /></td>
						      	</tr>
						      	
						      	<h:panelGroup rendered="#{gp.impar}">
							      	<tr>
							        	<td height="30" align="center" bgcolor="#f5f5f5" id="texto_preto_normal">
							        		<h:outputText value="#{gp.parceiro.nomeFantasia}" />
							        	</td>
							        	<td align="center" bgcolor="#f5f5f5" id="texto_preto_normal">
							        		<h:outputText value="#{gp.valor}" >
							        			<f:convertNumber type="currency" />
							        		</h:outputText>
							        	</td>
							        	<td align="center" bgcolor="#f5f5f5" id="texto_destaque_menorpreco2">
							        		<h:outputText value="#{gp.preco}" >
							        			<f:convertNumber type="currency" />
							        		</h:outputText>
							        	</td>
							        	<td align="center" bgcolor="#f5f5f5" id="texto_preto_normal">
							        		<h:outputText value="#{gp.dataFim}" >
							        			<f:convertDateTime pattern="dd/MM/yyyy" />
							        		</h:outputText>
							        	</td>
							        	
							    	</tr>
							   	</h:panelGroup>    
							   	<h:panelGroup rendered="#{!gp.impar}">
							      	<tr>
							        	<td height="30" bgcolor="#FFFFFF" align="center" id="texto_preto_normal">
							        		<h:outputText value="#{gp.parceiro.nomeFantasia}" />
							        	</td>
							        	<td bgcolor="#FFFFFF" align="center" id="texto_preto_normal">
							        		<h:outputText value="#{gp.valor}" >
							        			<f:convertNumber type="currency" />
							        		</h:outputText>
							        	</td>
							        	<td bgcolor="#FFFFFF" align="center" id="texto_destaque_menorpreco2">
							        		<h:outputText value="#{gp.preco}" >
							        			<f:convertNumber type="currency" />
							        		</h:outputText>
							        	</td> 
							        	<td bgcolor="#FFFFFF" align="center" id="texto_preto_normal">
							        		<h:outputText value="#{gp.dataFim}" >
							        			<f:convertDateTime pattern="dd/MM/yyyy" />
							        		</h:outputText>
							        	</td> 	
							        	
					      			</tr>
					      		</h:panelGroup>	
						    </a4j:repeat>  	
					      	
					     </table>
					  </div>
				</div>	      	
			

			</h:form>
		</ui:define>
	</ui:composition>

</html>